package model

import "gorm.io/gorm"

type UserModel struct {
	gorm.Model
	UserName     string       `gorm:"size:32;column:user_name;unique;comment:用户名"`
	NickName     string       `gorm:"size:32;column:nick_name;comment:昵称"`
	UserPassword string       `gorm:"size:128;column:user_password;comment:用户密码"`
	Avatar       string       `gorm:"size:32;column:avatar;comment:用户头像"`
	Email        string       `gorm:"size:32;column:email;comment:用户邮箱"`
	IsAdmin      bool         `gorm:"column:is_admin;default:false;comment:是否为管理员"`
	RoleList     []*RoleModel `gorm:"many2many:user_role_models"` // user_role_models是连接表，会在声明的时候自动创建
}
